package com.jerry.template.module.mianpage.shouye.recommend.home.fragment;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.Gravity;
import android.widget.Toast;

import com.jerry.template.R;
import com.jerry.template.base.BaseFragment;
import com.jerry.template.module.mianpage.shouye.recommend.home.adapter.UserFragmentVpAdapter;
import com.jerry.template.module.mianpage.shouye.recommend.home.entity.RecommendUserDetailEntity;
import com.jerry.template.module.mianpage.shouye.recommend.home.entity.TouGaoEntity;
import com.jerry.template.views.SlidingTabLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;


/**
 * Created by Administrator on 16-5-13.
 */
public class UserDetailFragment extends BaseFragment {
    private String user_id;
    //用户投稿收藏评论滑动控件
    @BindView(R.id.sliding_tab)
    public SlidingTabLayout tabLayout;

    @BindView(R.id.user_vp)
    public ViewPager userVp;

    private UserFragmentVpAdapter adapter;
    private List<Fragment> list;

    //用户投稿数据
    private TouGaoEntity touGaoEntity;
    // 务必实现空参数构造方法
    public UserDetailFragment(){

    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_user_detail_tab_viewpager;
    }

    @Override
    protected void getReqParams(Bundle bundle) {
        user_id = bundle.getString("user_id");
    }

    @SuppressLint("NewApi")
    @Override
    protected void initViews() {
        //设置滚动条颜色
        tabLayout.setSelectedIndicatorColors(Color.argb(255, 0x59, 0xA9, 0xFF));


        list = new ArrayList<>();

        //设置适配器
        adapter = new UserFragmentVpAdapter(getChildFragmentManager(),user_id);
        //适配器加载到ViewPager上
        userVp.setAdapter(adapter);
        //滚动条关联ViewPager
        tabLayout.setViewPager(userVp);

    }

    @Override
    protected void loadData() {

    }
}
